using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DTO;
using BUS;
using Utility;
public partial class Admin_diadiemupdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            txt_madoanhnghiep.Text = id.ToString();

            tbdiadiem diadiem = tbdiadiemBUS.GetByID(id);
            txt_tendoanhnghiep.Text = diadiem.Tendiadiem;
           
            txt_daichi.Text = diadiem.Diachi;
          
            txt_sdt.Text = diadiem.Sodienthoai;
            
            txt_email.Text = diadiem.Email;
        }
        catch
        {
            Response.Redirect("~/Admin/diadiemlist.aspx");
        }
    }
    protected void btn_Update_Click(object sender, EventArgs e)
    {
        {
            try
            {
                int id = int.Parse(Request.QueryString["id"].ToString());
                tbdiadiem diadiem = tbdiadiemBUS.GetByID(id);
                diadiem.Tendiadiem = txt_tendoanhnghiep.Text;
                tbdiadiemBUS.Update(diadiem);
            }
            catch (Exception ex)
            {
                Response.Redirect("~/Admin/diadiemlist.aspx");
            }
            Response.Redirect(Request.RawUrl);
        }
    }
}
